package com.cskaoyan.catmall.controller.wx;

import com.cskaoyan.catmall.model.vo.*;
//import com.cskaoyan.catmall.model.vo.TopicListVo;
import com.cskaoyan.catmall.service.WxTopicService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


/**
 * 创建日期: 2022-01-09-22-14
 * author : XGQ
 * description: 专题相关的接口
 */
@RestController
@RequestMapping("wx/topic")
public class WxTopicController {

    @Autowired
    WxTopicService wxTopicService;

    @GetMapping("detail")
    public BaseRespVo<TopicDetailVo> detailList(Integer id) {
        TopicDetailVo topicDetailVo = wxTopicService.getDetailById(id);
        return BaseRespVo.ok(topicDetailVo);
    }

    @GetMapping("related")
    public BaseRespVo<TopicRelatedVo> relatedList(Integer id) {
        TopicRelatedVo topicRelatedVo = wxTopicService.getRelatedById(id);
        return BaseRespVo.ok(topicRelatedVo);
    }

    @GetMapping("list")
    public BaseRespVo<TopicListVo> topicList(Integer page, Integer limit) {
        TopicListVo topicListVo = wxTopicService.getTopicList(page,limit);
        return BaseRespVo.ok(topicListVo);
    }

}
